#Author:jtt
#Content:XunLianYing
from selenium.webdriver.common.by import By

from page.base import Base


class Shop(Base):
    def shop(self):
        # self.driver.find_element_by_class_name('ecsc-search-button').click()
        self.click(By.CLASS_NAME,'ecsc-search-button')
        # self.driver.find_element_by_class_name('p-btn').click()
        self.click(By.CLASS_NAME, 'p-btn')
        # self.driver.find_element_by_id('join_cart').click()
        # self.click(By.ID, 'join_cart')

        # 两种方式都可以
        self.driver.switch_to.frame("layui-layer-iframe1")
        # self.driver.switch_to.frame(self.driver.find_elements_by_tag_name("ifame"))

        msg = self.driver.find_element_by_css_selector(".conect-title > span:nth-child(1)").text
        print(msg)